const { uploadFiles } = require('../utils/upload');
// 图片上传
async function upload(req, res) {
    console.log("req.files",req);
    // 配置图片上传到相关信息
    const images = uploadFiles();
    images(req, res, (err) => {
        if (err) {
            console.log('图片上传失败', err);
        } else {
            console.log('上传成功', req.files);
            res.send({
                status: 1,
                message: '上传成功',
                data: req.files[0].filename
            })
        }
    });
}

module.exports = { upload }